package com.accp.vehiclecare.biz.syhbiz;

import com.accp.vehiclecare.dao.syhdao.*;
import com.accp.vehiclecare.pojo.*;
import com.accp.vehiclecare.vo.syhvo.ServiceitxVo;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class OptionBiz {

    @Resource
    private IShiftsDao shiftsDao; //班次

    @Resource
    private IServiceitemtypeDao serviceitemtypeDao; //类型

    @Resource
    private IClearingformDao clearingformDao; //结束方式

    @Resource
    private IOilmassDao oilmassDao; //油量

    @Resource
    private IserviceitemDao serviceitemDao;

    @Resource
    private IMnpricetypeDao mnpricetypeDao;

    @Resource
    private Iprice iprice;

    @Autowired
    private IArvehicleDao arvehicleDao; //外勤车辆


    public List<Serviceitemtype> querlx(){
        return serviceitemtypeDao.selectList(null);
    }

    public List<Shifts> querbc(){
        return shiftsDao.selectList(null);
    }

    public List<Clearingform> querjs(){
        return clearingformDao.selectList(null);
    }

    public List<Oilmass> queryyl(){
        return oilmassDao.selectList(null);
    }

    public List<ServiceitxVo> queryxm(){
        return serviceitemDao.queryserviceitxes();
    }

    public List<Mnpricetype> queryjl(){
        return mnpricetypeDao.selectList(null);
    }

    public Serviceitem query(Integer id){
        QueryWrapper qw = Wrappers.query();
        qw.eq("serviceitemid",id);

        return iprice.selectOne(qw);
    }

    /**
     * 查询外勤车辆
     * @param aid
     * @return
     */
    public List<Arvehicle> queryarvehicle(Integer aid){
        QueryWrapper qw=Wrappers.query();
        qw.eq("artisansid",aid);
        return arvehicleDao.selectList(qw);
    }

}
